****FIGURE 1****

cd "$main_dir/output/figures/main"

graph set window fontface "Palatino"

//--------------------------------------------------------
//Create Figure 1
//--------------------------------------------------------

//1958
clear
use "$data_dir/clean/anes_cohort_panel.dta"

scatter trust_fed_govt chrt_wgrowth_rate_1 if survey_year==1958 & chrt_total>=50 & chrt_total!=., mlabposition(3) mlabsize(large) mlabel(cohort) mlabcolor(black) xtitle(Average Lifetime Growth Experience) || ///
	lfit trust_fed_govt chrt_wgrowth_rate_1 if survey_year==1958 & chrt_total>=50 & chrt_total!=., title(1958, color(black) size(huge)) graphregion(color(white)) bgcolor(white) ///
	xlabel(0.015(0.002)0.02,labs(medium)) xtitle("Average Growth Experience", margin(small) size(medium)) ///
	ylabel(0.65(0.0375)0.8,labs(medium) format(%9.2f)) ytitle("Trust in the Federal Government", margin(small) size(medium)) legend(off)
graph export "figure_1a.png", replace
graph export "figure_1a.tif", replace as(tif) width(3600)

//2018
clear
use "$data_dir/clean/country_year_cohort_panel.dta"
											
scatter trust_govt chrt_wgrowth_rate_1 if ccode=="USA" & survey_year==2018 & chrt_total>=50 & chrt_total!=. & cohort!="1930s", mlabposition(3) msymbol(T) mlabsize(large) mlabel(cohort) mlabcolor(black) mcolor(navy) || ///
	scatter trust_govt chrt_wgrowth_rate_1 if ccode=="USA" & survey_year==2018 & chrt_total>=50 & chrt_total!=. & cohort=="1930s", mlabposition(9) mlabsize(large) mlabel(cohort) mlabcolor(black) mcolor(navy) || ///
	lfit trust_govt chrt_wgrowth_rate_1 if ccode=="USA" & survey_year==2018 & chrt_total>=50 & chrt_total!=., lcolor(maroon) title(2018, color(black) size(huge)) graphregion(color(white)) bgcolor(white) ///
	xlabel(0.011(0.002)0.018,labs(medium)) xtitle("Average Growth Experience", margin(small) size(medium)) ///
	ylabel(0.2(0.1)0.5,labs(medium) format(%9.2f)) ytitle("Trust in the Federal Government", margin(small) size(medium)) legend(off)
graph export "figure_1b.png", replace
graph export "figure_1b.tif", replace as(tif) width(3600)
